//
//  UIFont+Extension.h
//  TableDemo
//
//  Created by jutuo on 2020/3/25.
//  Copyright © 2020 jutuo. All rights reserved.
//


#import <UIKit/UIKit.h>
#import <CoreText/CoreText.h>
NS_ASSUME_NONNULL_BEGIN

@interface UIFont (Extension)
@property (nonatomic, readonly) BOOL isBold NS_AVAILABLE_IOS(7_0);
@property (nonatomic, readonly) BOOL isItalic NS_AVAILABLE_IOS(7_0);
@property (nonatomic, readonly) BOOL isMonoSpace NS_AVAILABLE_IOS(7_0);
@property (nonatomic, readonly) BOOL isColorGlyphs NS_AVAILABLE_IOS(7_0);
@property (nonatomic, readonly) CGFloat fontWeight NS_AVAILABLE_IOS(7_0);

- (nullable UIFont *)fontWithBold NS_AVAILABLE_IOS(7_0);

- (nullable UIFont *)fontWithItalic NS_AVAILABLE_IOS(7_0);

- (nullable UIFont *)fontWithBoldItalic NS_AVAILABLE_IOS(7_0);

+ (nullable UIFont *)fontWithCTFont:(CTFontRef)CTFont;

+ (UIFont *)fontWithCGFont:(CGFontRef)CGFont size:(CGFloat)size;

- (nullable CTFontRef)CTFontRef CF_RETURNS_RETAINED;

- (nullable CGFontRef)CGFontRef CF_RETURNS_RETAINED;

// 系统普通字体，字号，根据屏幕适配改版大小
+ (UIFont *)fontScaleByDevice:(CGFloat)fontSize;

// 系统普通加粗字体，字号, 根据屏幕适配改版大小
+ (UIFont *)boldFontScaleByDevice:(CGFloat)fontSize;
@end

NS_ASSUME_NONNULL_END
